<template>
  <div>
    <CategorySelector></CategorySelector>
    <el-card>
      <SpuList v-if="scene == 1" @changeValue="saveScene"></SpuList>
      <SpuForm v-else-if="scene == 2" @changeValue="saveScene"></SpuForm>
      <SkuForm v-else-if="scene == 3"></SkuForm>
    </el-card>
  </div>
</template>

<script lang="ts">
import CategorySelector from "@/components/CategorySelector/index.vue";
import SpuList from "./components/SpuList.vue";
import SpuForm from "./components/SpuForm.vue";
import SkuForm from "./components/SkuForm.vue";
export default {
  name: "Spu",
  components: { CategorySelector },
};
</script>

<script lang="ts" setup>
import { ref } from "vue";
const scene = ref(1);

// 定义跳转函数
const saveScene = (val: number) => {
  scene.value = val;
};
</script>

<style>
</style>